﻿<Window x:Class="IPWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:local="clr-namespace:InteropTest"
    x:Name="IPWindow"
    Title="MainWindow" Height="500" Width="810">    
    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ShowGridLines="False" Width="{Binding}" Height="{Binding}"  Background="{DynamicResource AppGradient}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition Width="6" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="20" />
            <RowDefinition x:Name="CenterRow" Height="{Binding}" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>
        <WindowsFormsHost Grid.Row="1" Grid.Column="0" x:Name="winForms" HorizontalAlignment="Stretch" Margin="10,10,10,10" VerticalAlignment="Stretch">
            <wf:PropertyGrid x:Name="_props" Dock="Fill"></wf:PropertyGrid>               
        </WindowsFormsHost>
        <Menu x:Name="menuBar" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="20" Grid.Row="0" Grid.ColumnSpan="3">
            <MenuItem x:Name="fileMenu" Header="_File" >
                <MenuItem.Items>
                    <MenuItem x:Name="ShowPrg" Header="_Show File Assocation Window" />
                    <MenuItem x:Name="ShowHw" Header="_Show Computer Hardware Tree" />
                    <MenuItem x:Name="ShowFS" Header="_Show FileSystemMonitor" />
                    <MenuItem x:Name="ShowHID" Header="_Show HID Feature Code Explorer" />
                    <MenuItem x:Name="Quit" Header="_Quit" />
                </MenuItem.Items>
            </MenuItem>    
        </Menu>
        
        <GridSplitter Grid.Row="1" Grid.Column="1" ResizeDirection="Columns" 
                    HorizontalAlignment="Stretch" 
                    Opacity="0.5"
                    Background="AliceBlue"
                    VerticalAlignment="Stretch"/>
        
        
        <ListView 
            x:Name="AdapterList" 
            HorizontalAlignment="Stretch" 
            VerticalAlignment="Stretch" 
            Width="{Binding}" 
            Height="{Binding}" 
            Grid.Row="1" 
            Grid.Column="2" 
            Background="{x:Null}">

            <ListView.ContextMenu>
                <ContextMenu x:Name="netMenu" 
                             DataContext="{Binding IPWindow}" 
                             ItemsSource="{Binding ViewMenu}" />
                
            </ListView.ContextMenu>
            
            <ListView.View>
                <GridView x:Name="netGridView">
                    <GridViewColumn Width="204" Header="Adapter Name"
                        CellTemplate="{DynamicResource ImgCell}"
                        />
                    <GridViewColumn Width="140" Header="Connection Name"
                        DisplayMemberBinding="{Binding FriendlyName}" />
                    <GridViewColumn Width="140" Header="Type"
                        DisplayMemberBinding="{Binding IfType}" />
                    <GridViewColumn Width="140" Header="IP Address"
                        DisplayMemberBinding="{Binding FirstUnicastAddress.Next}" />
                    <GridViewColumn Width="140" Header="IP v6 Address"
                        DisplayMemberBinding="{Binding FirstUnicastAddress}" />
                    <GridViewColumn Width="140" Header="Network"
                        DisplayMemberBinding="{Binding DnsSuffix}" />
                    <GridViewColumn Width="140" Header="Physical Address"
                        DisplayMemberBinding="{Binding PhysicalAddress}" />

                    <GridViewColumn Width="140" Header="Device Name"
                        DisplayMemberBinding="{Binding DeviceInfo.Description}" />

                    <GridViewColumn Width="140" Header="Instance Id"
                        DisplayMemberBinding="{Binding DeviceInfo.InstanceId}" />


                </GridView>
            </ListView.View>
        </ListView>
        <StatusBar Grid.Row="2" Grid.ColumnSpan="3"/>
    </Grid>
</Window>
